home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Dec 89 / 0248-Re Associating Two F-Dec89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.4 KB  |  56 lines  |  [TEXT/GEOL]

  1. Item    3297077                         21-Dec-89        13:16
  2.  
  3. From:   CDA0004                         VAR Shana Enterprises, Don Murphy
  4.  
  5. To:     D5369                           Mgmt Sys Des, Chuck McMath,PRT
  6.         MACAPP.TECH$                    MacApp Technical
  7.  
  8. Sub:    Re-Associating Two Files
  9.  
  10. Attn: Mgmt Sys Des, Chuck McMath,PRT
  11. Attn: MacApp Technical
  12. SentBy: Wayne Malkin
  13. Date   12/21/89
  14. Subject    Re-Associating Two Files
  15. From   Wayne Malkin
  16. To Mgmt Sys Des, Chuck McMath,PRT
  17. CC MacApp Technical
  18.  
  19.          Reply to:   Re-Associating Two Files
  20. Chuck,
  21.  
  22. You are correct that the information you should store is volume name,
  23. directory id, and file name.
  24.  
  25. By the way, the volume name can be a Str27 and the file name can be a Str31.
  26. Str255 is over kill.
  27.  
  28. To get the vRefNum from the volume name, call PBGetVInfo:
  29.  
  30. VAR
  31.   pb : ParamBlockRec;
  32.   theName : Str255;
  33.  
  34. WITH pb DO
  35.   BEGIN
  36.     theName := CONCAT (volName,':');
  37.     ioNamePtr := @theName;
  38.     ioVRefNum := 0;
  39.     ioVolIndex := -1;
  40.   END;
  41. FailOSErr (PBGetVInfo (@pb,FALSE));
  42. vRefNum := pb.ioVRefNum;
  43.  
  44.  
  45. This returns the volume ref num (which is for the volume, not the directory
  46. you want). I have previously just used PBHOpen at this point to open the file
  47. based on its name and directory id. I think this is the right way to do it,
  48. but if you need a working directory refnum to pass to another routine, you can
  49. call PBOpenWD to open the working directory (IM IV-158).
  50.  
  51. Regards,
  52.  
  53. Wayne Malkin
  54.  
  55.  
  56.